home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / ear / uniq.readme < prev    next >
Text File  |  1994-06-11  |  5KB  |  158 lines

  1.                                 Uniq V1.1
  2.                         Written by Oliver Kaufmann
  3.                         Released on June 10,  1994
  4.  
  5.  
  6.      This program is Freeware. Copyright 1994 by Oliver Kaufmann.
  7. All Rights Reserved.  UNIQ is freely distributable, but the author retains all
  8. rights in regards to the program.  Permission is granted to distribute this
  9. program for a minimal charge (for copying, handling, etc.).
  10.      Use this program at your own risk,  no warranties will be made.
  11.  
  12.  
  13.      UNIQ is a Shell-command primarily designed to make life easier with file
  14. name length convention on different file systems such as MSDOS, but it is not
  15. limited to that. UNIQ takes its input either from stdin or from the contents
  16. of a specified directory. Its output will give those (file) names that do not
  17. comply with the requested name length followed by a "UNIQified" name, which
  18. is unique to the entire input. Thus it is easy to have those files renamed to
  19. properly comply with the destination filing system name length convention.
  20.  
  21.  
  22.  
  23. 1. INSTALLATION
  24. ---------------
  25.  
  26. Copy UNIQ to any directory you like that is in your path.
  27.  
  28.  
  29.  
  30. I. USAGE
  31. --------
  32.  
  33. uniq [<options>]
  34.           -d[<dir>] : use contents of <dir> as input, otherwise use stdin
  35.                  -a : print all names, even those which do not change
  36.                  -f : process files only, no dirs (requires -d option)
  37.                  -q : enclose output in quotes (rename "%s" "%s")
  38.                  -r : recurse sub-dirs (requires -d option)
  39.         -l<lformat> : use <lformat> for formated output (default rename %s %s)
  40.       -m[<mformat>] : enable & print <mformat> for dirs (default makedir %s)
  41.         -p<pattern> : pattern to apply (default #?)
  42.  -b<basenamelength> : max. length of the uniqified string (default 8)
  43. -e<extensionlength> : max. length of the uniqified extension (default 3)
  44.  
  45.  
  46. II. WHAT IS IT FOR
  47. ------------------
  48.  
  49. Suppose you've got a lot of pictures taken from internet news, let's say
  50. alt/binaries/pictures. Usually no problem for the Amiga, but possibly a
  51. firend of yours, who's only got a PC running MSDOS, wants to get the
  52. pictures from you. The problem is that some file names are too long for
  53. MSDOS, 8 + 3 = 11 chars max file name length. Even worse many pics do have
  54. allmost the same names except for the last character. If you copy such files
  55. to a MSDOS floppy or harddisk, you will probably get only one out of several.
  56. You may rename them by hand, but that's quite annoying, especially if there
  57. are over 1200 pics in that directory. Now you probably know what UNIQ might
  58. be used for.
  59.  
  60.  
  61. III. HOW IT WORKS
  62. -----------------
  63.  
  64. UNIQ takes its input, applies the pattern, checks the matched input for
  65. consistency with the (specified) length and, if necessary, prints a list of
  66. source names along with their corresponding UNIQified names. The unique
  67. names will be derived from the source names, modified and attached numbers,
  68. while the extension will be preserved, maybe truncated. By default UNIQ
  69. prints 'rename <source file> <unique file>' to stdout. You may redirect
  70. the output to a file and execute it afterwards to have the job done.
  71. Remember that by default UNIQ reads from stdin. If you want to use a
  72. directory as input you have to apply the -d switch (-d is the current,
  73. -d<dir> is any you specify). No path will be printed. Be aware that all
  74. arguments to switches must be directly typed after the switch, no spaces
  75. in between. If reading from stdin without redirection you finish typing by
  76. pressing CTRL-\ twice.
  77.  
  78.  
  79. IV. EXAMPLES
  80. -------------
  81.  
  82. Let's have UNIQ examine the contents of the current directory and list all
  83. files which do not comply with the (default) MSDOS name length convention.
  84. Look at that:
  85.  
  86. :> uniq -d
  87.  
  88. Now you can do
  89.  
  90. :> uniq -d >ram:test.bat
  91. :> execute ram:test.bat
  92.  
  93. If you don't want to rename the files you can copy them (see the -a for all)
  94. Let's say msd: is the MSDOS DISK
  95.  
  96. :> uniq -d -a "-lcopy %s msd:%s" >ram:test.bat
  97. :> execute ram:test.bat
  98.  
  99. Or read from stdin
  100.  
  101. :> uniq "-lthis is not uniq: %s should be %s" <testfile.idx
  102.  
  103. Or copy all files from dh0:data recursively to the current dir
  104.  
  105. :> uniq -ddh0:data -f -q -r "-lcopy %s %s" -m -a
  106.  
  107. Or copy all files from dh0:data recursively to msd:
  108. Remember that we do NOT use -q here!
  109.  
  110. :> uniq -ddh0:data -f -r "-lcopy ""%s"" ""msd:%s""" -m -a
  111.  
  112.  
  113. 2. Inspiration
  114. --------------
  115.  
  116. This Program was written, because I had to transfer about 400MB of data
  117. gathered from UNIX to a MSDOS harddisk.
  118.  
  119.  
  120. 3. Misc
  121. -------
  122.  
  123. This program is far from complete and has not been tested too much, but it
  124. works for me.
  125.  
  126.  
  127. 4. Source
  128. ---------
  129.  
  130. I've included the source code. Everybody may use it, implement other
  131. features etc. as long as the author is mentioned.
  132.  
  133.  
  134.  
  135. 5. The Author
  136. -------------
  137.  
  138.      Oliver Kaufmann
  139.      Eserwallstrasse 8
  140.      86159 Augsburg
  141.      Germany                e-mail: kaufmano@informatik.tu-muenchen.de
  142.  
  143.  
  144. 6.TODO
  145. ------
  146.  
  147. Switch to execute commands on the fly, instead of redirecting output.
  148.  
  149.  
  150. 7. History
  151. ----------
  152.  
  153. 1.02    first release
  154.     basic functions, no recursive dirs
  155. 1.1    recurse dirs, enclose output in quotes, mformat for dirs
  156.  
  157. DISCLAIMER:  Use this program at your own risk.
  158.